cmake_minimum_required(VERSION 3.25)
project(First)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 设置可执行文件输出路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# 设置头文件搜索路径
include_directories(
    ${PROJECT_SOURCE_DIR}/include
	${PROJECT_SOURCE_DIR}/libs
)

# 添加源文件
set(SOURCE_FILES main.cpp ${PROJECT_SOURCE_DIR}/src/glad.c)

# 添加可执行文件
add_executable(First ${SOURCE_FILES})

# 添加 GLFW
target_link_libraries(First
   ${PROJECT_SOURCE_DIR}/libs/libglfw3.a
   opengl32
)

include_directories(include/GLFW)
include_directories(include/glad)

# 链接静态库
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs)

set_target_properties(
		First
		PROPERTIES
		RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin
)